home *** CD-ROM | disk | FTP | other *** search
-
-
-
- PPPPOOOOLLLLLLLL((((2222)))) PPPPOOOOLLLLLLLL((((2222))))
-
-
-
- NNNNAAAAMMMMEEEE
- poll - input/output multiplexing
-
- SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
- ####iiiinnnncccclllluuuuddddeeee <<<<ssssttttrrrrooooppppttttssss....hhhh>>>>
- ####iiiinnnncccclllluuuuddddeeee <<<<ppppoooollllllll....hhhh>>>>
-
- iiiinnnntttt ppppoooollllllll((((ssssttttrrrruuuucccctttt ppppoooollllllllffffdddd ****ffffddddssss,,,, uuuunnnnssssiiiiggggnnnneeeedddd lllloooonnnngggg nnnnffffddddssss,,,, iiiinnnntttt ttttiiiimmmmeeeeoooouuuutttt))));;;;
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- The IRIX version of _p_o_l_l provides users with a mechanism for multiplexing
- input and output over a set of any type of file descriptors, rather than
- the traditional limitation to only descriptors of STREAMS devices [see
- _s_e_l_e_c_t(2)]. _P_o_l_l identifies those descriptors on which a user can send
- or receive messages, or on which certain events have occurred.
-
- _F_d_s specifies the file descriptors to be examined and the events of
- interest for each file descriptor. It is a pointer to an array with one
- element for each open file descriptor of interest. The array's elements
- are _p_o_l_l_f_d structures which contain the following members:
-
- int fd; /* file descriptor */
- short events; /* requested events */
- short revents; /* returned events */
-
- where _f_d specifies an open file descriptor and _e_v_e_n_t_s and _r_e_v_e_n_t_s are
- bitmasks constructed by or-ing any combination of the following event
- flags:
-
- POLLIN Data other than high priority data may be read without
- blocking. For STREAMS, the flag is set even if the
- message is of zero length.
-
- POLLRDNORM Normal data (priority band = 0) may be read without
- blocking. For STREAMS, the flag is set even if the
- message is of zero length.
-
- POLLRDBAND Data from a non-zero priority band may be read without
- blocking. For STREAMS, the flag is set even if the
- message is of zero length.
-
- POLLPRI High priority data may be received without blocking. For
- STREAMS, this flag is set even if the message is of zero
- length.
-
- POLLOUT Normal data may be written without blocking.
-
- POLLWRNORM The same as POLLOUT.
-
- POLLWRBAND Priority data (priority band > 0) may be written. This
- event only examines bands that have been written to at
- least once.
-
-
-
- PPPPaaaaggggeeee 1111
-
-
-
-
-
-
- PPPPOOOOLLLLLLLL((((2222)))) PPPPOOOOLLLLLLLL((((2222))))
-
-
-
- POLLERR An error message has arrived at the _s_t_r_e_a_m _h_e_a_d. This
- flag is only valid in the _r_e_v_e_n_t_s bitmask; it is not used
- in the _e_v_e_n_t_s field.
-
- POLLHUP A hangup has occurred on the _s_t_r_e_a_m. This event and
- POLLOUT are mutually exclusive; a _s_t_r_e_a_m can never be
- writable if a hangup has occurred. However, this event
- and POLLIN, POLLRDNORM, POLLRDBAND, or POLLPRI are not
- mutually exclusive. This flag is only valid in the
- _r_e_v_e_n_t_s bitmask; it is not used in the _e_v_e_n_t_s field.
-
- POLLNVAL The specified _f_d value does not belong to an open _s_t_r_e_a_m.
- This flag is only valid in the _r_e_v_e_n_t_s field; it is not
- used in the _e_v_e_n_t_s field.
-
- For each element of the array pointed to by _f_d_s, _p_o_l_l examines the given
- file descriptor for the event(s) specified in _e_v_e_n_t_s. The number of file
- descriptors to be examined is specified by _n_f_d_s. If _n_f_d_s exceeds
- NOFILES, the system limit of open files [see _u_l_i_m_i_t(2)], _p_o_l_l will fail.
-
- If the value _f_d is less than zero, _e_v_e_n_t_s is ignored and _r_e_v_e_n_t_s is set
- to 0 in that entry on return from _p_o_l_l.
-
- The results of the _p_o_l_l query are stored in the _r_e_v_e_n_t_s field in the
- _p_o_l_l_f_d structure. Bits are set in the _r_e_v_e_n_t_s bitmask to indicate which
- of the requested events are true. If none are true, none of the
- specified bits is set in _r_e_v_e_n_t_s when the _p_o_l_l call returns. The event
- flags POLLHUP, POLLERR and POLLNVAL are always set in _r_e_v_e_n_t_s if the
- conditions they indicate are true; this occurs even though these flags
- were not present in _e_v_e_n_t_s.
-
- If none of the defined events have occurred on any selected file
- descriptor, _p_o_l_l waits at least _t_i_m_e_o_u_t msec for an event to occur on any
- of the selected file descriptors. On a computer where millisecond timing
- accuracy is not available, _t_i_m_e_o_u_t is rounded up to the nearest legal
- value available on that system. If the value _t_i_m_e_o_u_t is 0, _p_o_l_l returns
- immediately. If the value of _t_i_m_e_o_u_t is -1, _p_o_l_l blocks until a
- requested event occurs or until the call is interrupted. _p_o_l_l is not
- affected by the O_NDELAY and O_NONBLOCK flag.
-
- _p_o_l_l fails if one or more of the following are true:
-
- [EAGAIN] Allocation of internal data structures failed but request
- should be attempted again.
-
- [EFAULT] Some argument points outside the allocated address space.
-
- [EINTR] A signal was caught during the _p_o_l_l system call.
-
- [EINVAL] The argument _n_f_d_s is less than zero, or _n_f_d_s is greater than
- NOFILES.
-
-
-
-
- PPPPaaaaggggeeee 2222
-
-
-
-
-
-
- PPPPOOOOLLLLLLLL((((2222)))) PPPPOOOOLLLLLLLL((((2222))))
-
-
-
- SSSSEEEEEEEE AAAALLLLSSSSOOOO
- intro(2), select(2), read(2), write(2), getmsg(2), putmsg(2), streamio(7)
-
- DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
- Upon successful completion, a non-negative value is returned. A positive
- value indicates the total number of file descriptors that has been
- selected (i.e., file descriptors for which the _r_e_v_e_n_t_s field is non-
- zero). A value of 0 indicates that the call timed out and no file
- descriptors have been selected. Upon failure, a value of -1 is returned
- and _e_r_r_n_o is set to indicate the error.
-
-
- NNNNOOOOTTTTEEEESSSS
- Some devices do not support polling via the _s_e_l_e_c_t(2) and _p_o_l_l(2) system
- calls. Doing a _s_e_l_e_c_t or _p_o_l_l on a file descriptor associated with an
- "un-pollable" device will cause the _s_e_l_e_c_t or _p_o_l_l to return immediately
- with a success value of 0 and the with the corresponding file descriptor
- events of queried set true. For instance, if a _s_e_l_e_c_t or _p_o_l_l is
- performed on a read file descriptor associated with an un-pollable
- device, the call would return immediately, even though there may be
- nothing to read on the device. A subsequent _r_e_a_d(2) in this situation
- might return with a "bytes-read" count of 0 or might block if the device
- supports read blocking. Devices which exhibit this behavior (especially
- those from third-party vendors) should be suspected as not supporting
- polling.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 3333
-
-
-
-